package 线程的创建;
//继承Thread类创建多线程
public class text1 {
    public static void main(String[] args) {
        //创建线程对象
        MyThread myThread = new MyThread();
        //启动线程
        myThread.start();
        //在主方法中执行其他任务
        while(true){
            System.out.println("主线程正在运行");
        }
    }
}
class MyThread extends Thread {
    public void run() {
        while(true){
            System.out.println("线程正在运行");
        }
    }
}
